home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
etc
/
init.d
/
readahead-desktop
< prev
next >
Wrap
Text File
|
2008-10-27
|
2KB
|
84 lines
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: readahead-desktop
# Required-Start: $local_fs readahead
# Required-Stop:
# X-Start-Before: $network
# Default-Start: S
# Default-Stop:
# Short-Description: init script for readahead (second stage)
### END INIT INFO
# Check the package is still installed
[ -x /sbin/readahead-list ] || exit 0
# Get LSB functions
. /lib/lsb/init-functions
. /etc/default/rcS
# Remember that any major changes to this script need to also be made to
# readahead.init
# Remove the desktop list to disable this readhead phase
[ -r /etc/readahead/desktop ] || exit 0
case "$1" in
start|restart|force-reload)
# This script is only run if /usr or /var are on a different
# filesystem.
if mountpoint -q /usr; then
dirs="$dirs /usr"
fi
if mountpoint -q /var; then
dirs="$dirs /var"
fi
[ -n "$dirs" ] || exit 0
# This can take a while
if type usplash_write >/dev/null 2>&1; then
usplash_write "TIMEOUT 360" || true
fi
# If "profile" is placed on the kernel command-line we watch the boot
# sequence and generate new readahead lists, rather than read the lists
if ! grep -q "profile" /proc/cmdline; then
log_begin_msg "Reading files needed to boot (second stage)..."
if /sbin/start-stop-daemon --start --quiet \
--pidfile /var/run/readahead-list.bogus \
--startas /sbin/readahead-list -- -s /etc/readahead/desktop; then
log_end_msg 0
else
log_end_msg $?
fi
else
# Move the first stage's pid file so we can still kill it later
mv /var/run/readahead-watch.pid /var/run/readahead-watch-boot.pid
# Just watch the newly mounted directories
log_begin_msg "Preparing to profile boot sequence (second stage)..."
if /sbin/start-stop-daemon --start --quiet \
--pidfile /var/run/readahead-watch.bogus \
--startas /sbin/readahead-watch \
-- -o /etc/readahead/desktop $dirs; then
log_end_msg 0
else
log_end_msg $? || true
fi
fi
if type usplash_write >/dev/null 2>&1; then
usplash_write "TIMEOUT 15" || true
fi
;;
stop)
;;
*)
echo "Usage: /etc/init.d/readahead {start|stop|restart|force-reload}"
exit 1
;;
esac
exit 0